<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>招聘中心</title>
	<link rel="stylesheet" href="../css/main.css">
	<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
	<link rel="shortcut icon" href="../img/title/招聘求职.png" type="image/x-icon">
</head>
<body>
	<div id="app">
		<div class="header">
			<div class="header_left">
				<img src="../img/main/招聘会.png"	>
				<a href="../pages/main.html">&nbsp;校园招聘管理</a>
			</div>
			<div class="header_center">
				<ul>
					<li ><a style="color: lawngreen;" href="">主页</a></li>
					<li><a href="../pages/work_list.html">职位</a></li>
					<li><a href="./news.html">校园新闻</a></li>
				</ul>
			</div>
			<div class="header_right">
				<el-button @click="loginBtn" type="success" icon="el-icon-user-solid">登录</el-button>
				<el-button @click="registerBtn" type="success" icon="el-icon-takeaway-box">注册</el-button>
			</div>
		</div>
		<div class="content">
			<div class="condition">
				招聘管理系统
				<div style="font-size: 45px;">实现便捷的校园就业</div>
				<div>
					<el-button @click="start" type="success">点此开始<i class="el-icon-upload el-icon--right"></i></el-button>	
				</div>
			</div>
		</div>
	</div>
</body>
<script src="../js/vue.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="../js/jquery-3.6.1.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script src="../js/after_landing.js"></script>
<script>
  const vm = new Vue({
    el: '#app',
	data(){
		return {
			userMsgList : [],
		}
	},
	created(){
	  let username = getCookie("cookie_username")
		if (username !== null && username.length > 0){
			axios.get('/users/'+username).then((resp)=>{
				this.userMsgList = resp.data.data
				$('.header_center ul').append(`<li><a href="./personal_resume.html">简历</a></li>`)
				$('.header_center ul').append(`<li><a href="./personal_center.html">个人中心</a></li>`)
				$('.header_right').empty()
				let url = this.userMsgList.user_image
				$(".header_right").append(`<img style="width: 7%;margin-right: 5px" src="${url}">${username}`);
				$(".header_right").append(`<a style="text-decoration: none;color: #77838e;margin-left: 5px" href="/logins/logout">注销</a>`);
			})
		} else {
			$('.header_center ul li:gt(2)').remove()
		}
	},
	methods: {
		loginBtn(){
			window.location.replace("/pages/login.html");
		},
		registerBtn(){
			document.location.href = "register.html"
		},
		start(){
			document.location.href = "work_list.html"
		}
	}
  })
</script>
</html>